#!/usr/bin/python
#
#    Copyright 2006 Andrew Wilkinson <aw@cs.york.ac.uk>.
#
#    This file is part of PyScobble (http://lastfm.indiegigs.co.uk/pyscrobble)
#
#    PyScobble is free software; you can redistribute it and/or modify
#    it under the terms of the GNU Lesser General Public License as published by
#    the Free Software Foundation; either version 2.1 of the License, or
#    (at your option) any later version.
#
#    PyScobble is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Lesser General Public License for more details.
#
#    You should have received a copy of the GNU Lesser General Public License
#    along with PyScobble; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

import sys

import scrobble

def getUserFriends(user):
    return user.friends

def getUserReverseFriends(user):
    return user.friends

def isFriendMutual(user1, user2):
    return True

def getUserNeighbours(user):
    return user.neighbours[:20]

def getUserReverseNeighbours(user):
    l = []
    for u in user.neighbours:
        if user in u.neighbours[:20]:
            l.append(u)
    return l

def isNeighbourMutual(user1, user2):
    return user2 in user1.neighbours and user1 in user2.neighbours

def getArtistSimilar(artist):
    return artist.similar[:10]

def getArtistReverseSimilar(artist):
    l = []
    for a in artist.similar:
        if artist in a.similar:
            l.append(a)
            if len(l) == 10:
                return l
    return l

def isArtistSimilarMutual(artist1, artist2):
    return artist2 in artist1.similar and artist1 in artist2.similar
